#include <bits/stdc++.h>
using namespace std;
//definition
const int MAXN = 1e5 + 100,MAXR = 1e5 + 100,INF = 0x3f3f3f3f;
int N,Value[MAXN];
int Cnt[MAXR],Pre[MAXN],Max = -1;

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    //
    //
    //init
    memset(Cnt,0,sizeof(Cnt));
    memset(Pre,0,sizeof(Pre));

    //input
    scanf("%d",&N);
    for(int i = 0;i < N;i ++) {
        scanf("%d",&Value[i]);
        Cnt[Value[i]] ++;
        Max = max(Max,Value[i]);
    }
    Pre[1] = Cnt[1];
    Pre[0] = 0;
    for(int i = 1;i <= Max;i ++){
        Pre[i] = Pre[i - 1] + Cnt[i];
    }
    Pre[Max + 1] = Pre[Max];

    //main
    for(int i = 2;i <= Max + 1;i ++){
        int Smaller = Pre[i - 1] - Pre[0];
        if(Cnt[i] > Smaller){
            Cnt[i] -= Smaller;
            Pre[0] += Smaller;
        }
        else if(Cnt[i] < Pre[i - 1]){
            Pre[0] += Cnt[i];
            Cnt[i] = 0;
        }
        else if(Cnt[i] == Pre[i - 1]){
            Pre[0] += Cnt[i];
            Cnt[i] = 0;
        }
    }

    //output
    printf("%d",Pre[Max + 1] - Pre[0]);
    //
    //
    fclose(stdin);
    fclose(stdout);
    return 0;
}
